<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<html>
<head>
<%@ include file="common.jsp"%>

<link type="text/css" rel="stylesheet"
	href="<%=rootPath%>/css/manage/selectResult.css" />
<title><%=proName%>-日志权限</title>
<script type="text/javascript">
    //保存已添加员工号
	function addGroupManager(){
    	var url = rootPath+"/workConPower/addGroupManagerByViewEmp.mge";
		var viewEmp = $("#viewEmpId").val();
		var beViewEmpIds = $("#beViewEmpIds").val();
		var comfirmStr = "确认添加权限？"
		if(confirm(comfirmStr)){
      		$.ajax({
      		  	url: url,
      		  	type: "POST",
      		  	data:"viewEmpId="+viewEmp+"&beViewEmpIds="+beViewEmpIds,
      		  	dataType: "text",
      		  	success: function( response ) {
      		  		var data=$.parseJSON(response);
      				if(data.state=="200"){
      					alert(data.msg);
      					goBack();
      				}else{
      					alert('fail',data.msg);
      				}
      		  	}
      		});
      	}
		
	}
    function goBack(){
    	var url = rootPath+"/workConPower/findManagerGroup.mge";
    	window.location.href=url;
    }
</script>
</head>

<body>
	<jsp:include page="./menu.jsp"></jsp:include>
	<div id="body">
		<div id="navTop">
			<div class="bg_left"></div>
			<div class="bg_main"></div>
			<div class="bg_right"></div>
		</div>
		<div id="userManager">
			<form id="saveForm" method="post" name="saveForm" action="<%=rootPath%>/workConPower/save.mge" title=''>
				<table width="100%" cellpadding="0" cellspacing="0" border="0"
					class="maintable">
					<tr>
						<th align="left">
				            <input id="save" type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="返   回" onclick="goBack()" onmouseover="this.style.background='#FFF18B'" onmouseout="this.style.background='#F1EDD2'" />
						</th>
						<th align="right">
							<input id="save" type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="保    存" onclick="addGroupManager()" onmouseover="this.style.background='#FFF18B'" onmouseout="this.style.background='#F1EDD2'" />
						</th>
					</tr>
					<tr>
						<td colspan="2"><h5>工号之间需用'|'间隔！如果要赋予查阅全部B类经理日志的权限，可在被查阅日志员工中填写“ALL”</h5></td>
					</tr>
					<tr>
						<td>
						<form id="deleteForm" method="post">
							<table class="admintable" width="100%" style="margin: auto">
								<tr>
									<th class="adminth">有查阅日志权限员工</th>
									<th class="adminth">被查阅日志员工</th>
								</tr>
								<tr>
									<td align=center style="width:20%"><input type="text" id="viewEmpId" style="width:90%" placeholder="可以输入多个工号，用|分割，例如8600001|8600002|"/></td>
									<td align="left" style="width:80%"><input type="text" id="beViewEmpIds" style="width:100%" placeholder="可以输入多个工号，用|分割，例如8600001|8600002|"/></td>
								</tr>
							</table>
						</form>
					</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<jsp:include page="./footer.jsp"></jsp:include>
</body>
</html>
